package com.yy.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yy.model.UserEntity;
import com.yy.service.UserService;
import com.yy.utils.IgnoreAuth;
import com.yy.utils.LoginUser;
import com.yy.utils.ResponseEntity;

/**
 * API测试接口
 *
 * @author 
 * @date 
 */
@RestController
@RequestMapping("/api")
public class ApiTestController {
    @Autowired
    private UserService userService;

    /**
     * 获取用户信息
     */
    @GetMapping("userInfo")
    public ResponseEntity userInfo(@LoginUser UserEntity user){

        return ResponseEntity.ok().put("user", user);
    }

    /**
     * 忽略Token验证测试
     */
    @IgnoreAuth
    @GetMapping("notToken")
    public ResponseEntity notToken(){
    	//测试返回用户数据
    	//UserEntity user= userService.queryByMobile("13612345678");
        //return ResponseEntity.ok().put("user", user);
        return ResponseEntity.ok().put("msg", "无需token也能访问。。。");
    }
}
